package org.qiandaosystem.qiandaosystemsource.dto;

import lombok.Data;
import org.qiandaosystem.qiandaosystemsource.entity.Teacher;
import org.qiandaosystem.qiandaosystemsource.entity.User;

@Data
public class TeacherDTO {
    private Integer id;
    private String username;
    private String realName;

    public static TeacherDTO fromEntity(Teacher teacher, User user) {
        TeacherDTO dto = new TeacherDTO();
        dto.setId(teacher.getUserId());
        dto.setUsername(user.getUsername());
        dto.setRealName(teacher.getRealName());
        return dto;
    }
} 